<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.thymeleaf.org" layout:decorator="home_layout">
<head>
    <!-- 气泡提示 -->
    <link rel="stylesheet" type="text/css" href="/css/balloon.min.css"/>
    <!-- 瀑布流 -->
    <link rel="stylesheet" type="text/css" href="/js/WaterfallFlow/component.css"/>
    <script type="application/javascript" src="/js/WaterfallFlow/modernizr.custom.js"/>
    <script type="application/javascript" src="/js/WaterfallFlow/masonry.pkgd.min.js"/>
    <script type="application/javascript" src="/js/WaterfallFlow/imagesloaded.js"/>
    <script type="application/javascript" src="/js/WaterfallFlow/classie.js"/>
    <script type="application/javascript" src="/js/WaterfallFlow/AnimOnScroll.js"/>
    <!-- cookie -->
    <script type="application/javascript" src="/js/js.cookie.js"/>
    <!-- 文本域自动扩展 -->
    <script type="application/javascript" src="/js/TextAreaExpander.js"/>
    <!-- layer弹窗 -->
    <script type="application/javascript" src="/js/layer/layer.js"/>
    <!-- 图片预览 -->
    <link rel="stylesheet" type="text/css" href="/picture-preview/picture-preview.css"/>
    <script type="application/javascript" src="/picture-preview/picture-preview.js"/>
    <!-- TAB标签切换 -->
    <link rel="stylesheet" type="text/css" href="/tab-toggle/tab-toggle.css"/>
    <script type="application/javascript" src="/tab-toggle/tab-toggle.js"/>
    <!-- 自定义 -->
    <script type="application/javascript" th:inline="javascript">
        $(function () {
            /*<![CDATA[*/
            scrollInPage = /*[[${session.scrollInPage}]]*/;
            /*]]>*/
        })
    </script>
    <link rel="stylesheet" type="text/css" href="/css/home.css"/>
    <script type="application/javascript" src="/js/ramer/home.js"/>
    <style type="text/css">
        .more {
            position: absolute;
            top: 300px;
            left: 0;
            padding: 10px;
            background: #009f95;
            transition: all 1s;
            z-index: 10000;
            width: 122px;
            color: rgba(255, 255, 255, .5);
            text-align: center;
            cursor: pointer;
        }

        .moreAm {
            animation: ramerAnimateTwo 1s linear;
        }

        .moreNew {
            margin-left: -50px;
            width: 120px;
            animation: ramerAnimate 1s linear;
            transform: scale(5);
            left: 50%;
            top: 50%;
            box-shadow: 0px 0px 30px rgb(0, 159, 149);
        }

        .showdata {
            background: none;
            opacity: 0;
            color: #FFFFFF;
            overflow: hidden;
            position: absolute;
            top: 40%;
            left: 40px;
            padding: 10px;
            width: 600px;
            transition: all .5s;
            z-index: 10001;
        }

        .showdata ul {
            line-height: 1.2em;
            width:: 100%;
            overflow: hidden;
        }

        .showdata ul li {
            padding: 10px;
            list-style: none;
            float: left;
        }

        .showdata a {
            color: #FFFFFF;
        }

        @keyframes ramerAnimateTwo {
            0% {
                top: 50%;
                left: 50%;
            }
            100% {
                top: 300px;
                left: 0%;
            }
        }

        @keyframes ramerAnimate {
            0% {
                left: 0;
                top: 300px;
            }
            100% {
                left: 50%;
                top: 50%;
            }
        }
    </style>
</head>
<body layout:fragment="page_body">
<!-- 分类面板 -->
<div class="category_panel">
    <!-- 标题面板 -->
    <div class="top">
        <div class="title textshadow"></div>
    </div>
    <ul class="category">
        <li>
            <a href="/home" data-toggle="默认">默认</a>
            <span id="newTopic" style="position: absolute; margin: 0px;"></span>
        </li>
        <li>
            <a href="/home/hot" data-toggle="热门">热门</a>
        </li>
        <li>
            <a href="/home/people" data-toggle="达人">达人</a>
        </li>
        <li>
            <a href="/home/tag" id="topTags" data-toggle="标签">标签</a>
        </li>
    </ul>
    <!-- 通过用户输入标签获取分享 -->
    <div class="query">
        <input type="text" name="tag" class="querytopic" autocomplete="false"/>
        <i class="material-icons">search</i>
        <!--<i class="icon-search search"></i>-->
    </div>
    <!-- 通过标签获取分享表单 -->
    <form action="/home/tag" id="tagForm">
        <input type="text" name="tag" id="tagName"/>
    </form>
    <!-- 已登录用户,未完善用户信息 -->
    <div th:if="not ${session.user eq null} and ${session.user.id gt 0} and ${session.user.registNav eq true}"
         class="profile">
        <img th:src="${session.user.head}" onerror="javascript:this.src='/pictures/userHead.jpg'"/>
    </div>
</div>
<!-- 已登录用户,未完善用户信息,用户链接面板 -->
<section th:if="not ${session.user eq null} and ${session.user.id gt 0}"
         class="user-section-nav">
    <ul class="user-link">
        <li>
            <i class="material-icons">photo</i>
            <a href="user/personal">分享</a>
            <span th:text="${topicNumber eq null ? 0 : topicNumber}"></span>
        </li>
        <li>
            <i class="material-icons">visibility</i>
            <a href="user/personal">关注</a>
            <span th:text="${followedNumber eq null ? 0 : followedNumber}"></span>
        </li>
        <li>
            <i class="material-icons">chat</i>
            <a href="user/personal">私信</a>
            <span th:text="${notifiedNumber eq null ? 0 : notifiedNumber}"></span>
        </li>
        <li>
            <i class="material-icons">vpn_key</i>
            <a href="user/forwardModifyPassword">密码管理</a>
        </li>
        <li>
            <i class="material-icons">contact_mail</i>
            <a href="user/forwardModifyEmail">绑定邮箱</a>
        </li>
        <li>
            <i class="material-icons">account_circle</i>
            <a th:href="|user/${session.user.id}|">个人信息</a>
        </li>
        <li>
            <i class="material-icons">settings</i>
            <a href="/settings">系统设置</a>
        </li>
        <li>
            <i class="material-icons">input</i>
            <a href="/logOff">注销</a>
        </li>
    </ul>
</section>
<div class="user-container"></div>
<!-- 上一页 -->
<div class="last_page" th:if="${session.scrollInPage eq false}">
    <a th:href="|?pageNum=${topPeoples.number + 1 - 1}|" id="lastPage">
        <i class="material-icons md-48">navigate_before</i>
        <!--<img alt="error" src="/pictures/previous.png"/>-->
    </a>
</div>
<!-- 显示达人 -->
<div class="container">
    <ul class="grid effect-2" id="grid">
        <th:block th:each="u:${topPeoples.content}">
            <li>
                <div class="user_mess">
                    <a th:href="|/user/personal/${u.id}|">
                        <img th:src="${u.topics[0].albums[0].url}" alt="error"
                             onerror="javascript:this.src='/pictures/userHead.jpg'"/>
                    </a>
                    <div class="name_panel">
                        <a th:href="|/user/personal/${u.id}|">
                            <img th:src="${u.head}" class="head"
                                 onerror="javascript:this.src='/pictures/userHead.jpg'"/>
                            <br/>
                            <span class="name" th:text="${u.username}"></span>
                        </a>
                    </div>
                </div>
            </li>
        </th:block>
    </ul>
    <!-- 存储记录的总页数 -->
    <input id="totalPages" type="hidden" th:value="${topPeoples.totalPages }"/>
    <!-- 存储当前页号 -->
    <input id="number" type="hidden" th:value="${topPeoples.number}"/>
</div>
<!-- 下一页 -->
<div class="next_page" th:if="${session.scrollInPage eq false}">
    <a th:href="|?pageNum=${topPeoples.number + 1 + 1}|" id="nextPage">
        <i class="material-icons md-48">navigate_next</i>
        <!--<img alt="error" src="/pictures/next.png"/>-->
    </a>
</div>
<input type="hidden" id="positionVal"/>
<input type="hidden"
       th:name="${_csrf.parameterName}"
       id="_csrf"
       th:value="${_csrf.token}"/>
<!-- 中英文切换 -->
<!--<select th:inline="text">-->
<!--<th:block th:if="${#locale.toString() eq 'zh'}">-->
<!--<option value="zh" selected="selected">中文</option>-->
<!--<option value="en">English</option>-->
<!--</th:block>-->
<!--<th:block th:if="${#locale.toString() == 'en'}">-->
<!--<option value="zh">中文</option>-->
<!--<option value="en" selected="selected">English</option>-->
<!--</th:block>-->
<!--</select>-->
</body>
<script layout:fragment="page_js">
    <!-- 瀑布流动画js -->
    new AnimOnScroll(document.getElementById('grid'), {
        minDuration: 0.4,
        maxDuration: 0.7,
        viewportFactor: 0.2
    });
</script>
</html>